package org.nox.helloseries.domain;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

public class Tracker implements Comparable<Tracker>
{
    private NomTracker nomTracker;

    private String priority;

    private boolean active;

    private Map<String, String> HTTPHeaders = new HashMap<>();

    public Tracker()
    {
        super();
    }

    public NomTracker getNomTracker()
    {
        return nomTracker;
    }

    public void setNomTracker( NomTracker nom )
    {
        this.nomTracker = nom;
    }

    public String getPriority()
    {
        return priority;
    }

    public void setPriority( String priority )
    {
        this.priority = priority;
    }

    public void setActive( boolean active )
    {
        this.active = active;
    }

    public boolean isActive()
    {
        return active;
    }

    public Map<String, String> getHTTPHeaders()
    {
        return HTTPHeaders;
    }

    @Override
    public boolean equals( Object obj )
    {
        if ( obj instanceof Tracker )
        {
            Tracker cible = (Tracker) obj;
            return Objects.equals( nomTracker, cible.nomTracker ) && Objects.equals( priority, cible.priority ) && Objects.equals( active, cible.active )
                && Objects.equals( HTTPHeaders, cible.HTTPHeaders );
        }
        return false;
    }

    @Override
    public String toString()
    {
        return "[active=" + active + ",nomTracker=" + nomTracker + ",priority=" + priority + ",HTTPHeaders=" + HTTPHeaders + "]";
    }

    @Override
    public int compareTo( Tracker arg1 )
    {
        if ( arg1 == null )
        {
            return 1;
        }
        return priority.compareTo( arg1.priority );
    }

}
